package com.donglan.pethome.organization.service.impl;

import com.donglan.pethome.basic.service.impl.BaseServiceImpl;
import com.donglan.pethome.organization.domain.Department;
import com.donglan.pethome.organization.mapper.DepartmentMapper;
import com.donglan.pethome.organization.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: zhangdonghui
 * @Date: 2021/10/24 18:09
 */
@Service
public class DepartmentServiceImpl extends BaseServiceImpl<Department> implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;


    @Override
    @Transactional
    public void addorUpdate(Department department) {
        if(department.getId() == null){
            this.add(department);
        }else{
            this.update(department);
        }
    }
}
